<%@ include file="/common/taglibs.jsp"%>

<div class="box_a" id="widget_L">

	<h2>Login<a href="#minimize" class="Sminimize"></a><a href="#close" class="Sclose"></a></h2>
	<div>
		<p>
		<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">			      
			    <c:if test="${pageContext.request.remoteUser != null}">
		        	 <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.status"/> <authz:authentication operation="fullName"/></fmt:bundle>!
		        </c:if>
				<a href="<c:url value='/logout.jsp'/>"><fmt:bundle basename="ApplicationResources"><fmt:message key="logo.logout"/></fmt:bundle></a>
		</authz:authorize>
		<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
		<fieldset>
				<input name="jive.login.successURL" value="/" type="hidden">
			    <input name="username" id="username" onKeyPress="javascript:checkEnterForLogin(event)" onfocus="swichForUser();" size="10" type="text" value="">
			    <input name="password" id="password" onKeyPress="javascript:checkEnterForLogin(event)" onfocus="swichForPass();" size="10" maxlength="16" value="" type="password">
			    
			    
			    <c:out value="${confirmed}"></c:out>			
					<c:choose>
						<c:when test="${param.r==1}">
							<input id="loginbutton" type="submit" value="(Re)Login" onclick="javascript:submitLoginForm();"/>
						</c:when>
						<c:otherwise>
							<input id="loginbutton" type="submit" value="Login" onclick="javascript:submitLoginForm();"/>
						</c:otherwise>
					</c:choose>
					<c:if test="${param.error != null}">
					    (try again!)
					</c:if>	
			</fieldset>
		</authz:authorize>

		<br>
       <span class="smalltext"> <c:out value="${usersNumber}"></c:out> <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.members"/></fmt:bundle>	
	  <authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
     	<a href="editUserProfile.html"><fmt:bundle basename="ApplicationResources"><fmt:message key="logo.signup"/></fmt:bundle></a> <fmt:bundle basename="ApplicationResources"><fmt:message key="logo.topublish"/></fmt:bundle></span>
	  </authz:authorize>
	  <authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
		<fmt:bundle basename="ApplicationResources">
	  	 <fmt:message key="logo.visitors"> 
			<fmt:param>
				<c:out value="${visitators}"></c:out>
			</fmt:param>	
		</fmt:message> 	
		</fmt:bundle>
	  </authz:authorize>
	  </p>	
	  <div class="hidden">
		<form method="post" id="loginForm" action="<c:url value='/j_security_check'/>" onsubmit="saveUsername(this);return validateForm(this)">
			<input id="j_username" name="j_username" type="hidden" value=""/>
			<input id="j_password" name="j_password" type="hidden" value="" type="password"/>
		</form>
	  </div>  			
	</div>
	
<span class="foot"></span>
</div>

<div class="box_a" id="widget_S">
		
	<h2>Subscription<a href="#minimize" class="Sminimize"></a><a href="#close" class="Sclose"></a></h2>
	<div>
	
	<p>Subscribe by <strong>RSS feed</strong> or by <strong>e-mail address</strong> to receive latest news and updates.</p>
	<p><a href="<c:url value="/rss_2.0"/>" id="feedlink">Subscribe by RSS feed</a></p>
	<form id="feedform" method="post" action="http://javaromania.list-manage.com/subscribe/post">
	<fieldset>
		<input id="feedemail" name="MERGE0" value="Enter your e-mail..." type="text">
		<input type="hidden" name="u" value="8ea88774785e1455432f3f3e1" />
		<input type="hidden" name="id" value="add0df0df8" /> 
		<input name="loc" value="en_US" type="hidden">
		<input id="feedbutton" value="Sign Up" type="submit">
	</fieldset>
	</form>
	
	</div>

<span class="foot"></span>
</div>

<div class="box_a" id="widget_A">

	<h2>Advertisement<a href="#minimize" class="Sminimize"></a><a href="#close" class="Sclose"></a></h2>
	<div>
	
	<p class="aligncenter"><a href="http://www.polirom.ro/catalog/carte/java-de-la-0-la-expert-1199/"><img src="http://farm4.static.flickr.com/3276/3044668451_99c06d0be9.jpg?v=0" alt=""></a></p>
	
	</div>

<span class="foot"></span>
</div>


<ul class="widgets">
		<li><h2><fmt:bundle basename="ApplicationResources"><fmt:message key="side.your.options" /></fmt:bundle><a href="#minimize" class="Wminimize"></a><a href="#close" class="Wclose"></a></h2>
		<ul>
			<li>
				<a href="editArticleContent${application_theme}.html">
					<strong>
						<fmt:bundle basename="ApplicationResources">
							<fmt:message key="side.new.article" />
						</fmt:bundle>
					</strong>
				</a>
				<br/>
				<fmt:bundle basename="ApplicationResources"><fmt:message key="side.new.article.info" /></fmt:bundle> 
			</li>
			
			<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
			<li>
				<a href="listArticles${application_theme}.html">
					<strong>
						<fmt:bundle basename="ApplicationResources">
							<fmt:message key="side.edit.article" />
						</fmt:bundle>
					</strong>
				</a>
				<br />
				<fmt:bundle basename="ApplicationResources">
					<fmt:message key="side.edit.article.info" />
				</fmt:bundle> 
			</li>
			<li>
				<a href="editUserProfile${application_theme}.html?id=<authz:authentication operation="id"/>">
					<strong>
						<fmt:bundle basename="ApplicationResources">
							<fmt:message key="side.edit.profile" />
						</fmt:bundle>
					</strong>
				</a>
				<br />
				<fmt:bundle basename="ApplicationResources">
					<fmt:message key="side.edit.profile.info" />
				</fmt:bundle> 
			</li>
			</authz:authorize> 
		</ul>
		<span class="foot"></span>	
	</li>
</ul>

<authz:authorize ifAnyGranted="ROLE_ADMIN">
	<ul class="widgets">
	
		<li><h2><fmt:bundle basename="ApplicationResources"><fmt:message key="side.administrative.options" /></fmt:bundle><a href="#minimize" class="Wminimize"></a><a href="#close" class="Wclose"></a></h2>
		<ul>
			<li>
					<a href="applicationConfiguration${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.edit.configuration" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.edit.configuration.info" />
					</fmt:bundle> 
			</li>
			<li>	
					<a href="aprouveArticlesList${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.manage.article" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.manage.article.info" />
					</fmt:bundle> 
			</li>
			<li>	
					<a href="aprouveUsersList${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.edit.users" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.edit.users.info" />
					</fmt:bundle> 
			</li>
			<li>	
					<a href="aprouveCommentsList${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.manage.comments" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.manage.comments.info" />
					</fmt:bundle> 
			</li>
			<li>	
					<a href="categories${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.edit.categories" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.edit.categories.info" />
					</fmt:bundle> 
			</li>
			<li>	
					<a href="links${application_theme}.html">
						<strong>
							<fmt:bundle basename="ApplicationResources">
								<fmt:message key="side.edit.links" />
							</fmt:bundle>
						</strong>
					</a>
					<br />
					<fmt:bundle basename="ApplicationResources">
						<fmt:message key="side.edit.links.info" />
					</fmt:bundle> 
			</li>
		</ul>
		<span class="foot"></span></li>
	
	</ul>
	
	<div class="clear"></div>
</authz:authorize>

<div class="box_a" id="widget_T">

	<h2>Hot topics<a href="#minimize" class="Sminimize"></a><a href="#close" class="Sclose"></a></h2>
	<div style="padding: 0pt;">
	
	<ul id="tabs" class="tabs">
		<li><a href="#recent-topics" rel="recent" class="selected">Recent Topics</a></li>
		<li><a class="" href="#most-viewed" rel="viewed">Most Viewed</a></li>
		<li><a class="" href="#most-discussed" rel="discussed">Most Discussed</a></li>
	</ul><div class="clear"></div>
	
	<ul style="display: block;" id="recent" class="tabcontent">
		<c:forEach var="article" items="${articlesVoting}" varStatus="rowCounter">
			<c:set var="articleContent">
				<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
					content_${article.titleLine}_${article.id}_${application_theme}.xhtml
				</authz:authorize>
				<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
					getArticleContent${application_theme}.html?id=${article.id}
				</authz:authorize>
			</c:set>
			<li><a href="${articleContent}" title="${article.overview}">${article.title}</a></li>			
		</c:forEach>
	</ul>

	<ul style="display: none;" id="viewed" class="tabcontent">
		<c:forEach var="article" items="${articlesVoting}" varStatus="rowCounter">
			<c:set var="articleContent">
				<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
					content_${article.titleLine}_${article.id}_${application_theme}.xhtml
				</authz:authorize>
				<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
					getArticleContent${application_theme}.html?id=${article.id}
				</authz:authorize>
			</c:set>
			<li><a href="${articleContent}" title="${article.overview}">${article.title} <span>viewed ${article.viewsNumber} times</span></a></li>			
		</c:forEach>
	</ul>
	
	<ul style="display: none;" id="discussed" class="tabcontent">
		<c:forEach var="article" items="${articlesVoting}" varStatus="rowCounter">
			<c:set var="articleContent">
				<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
					content_${article.titleLine}_${article.id}_${application_theme}.xhtml
				</authz:authorize>
				<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
					getArticleContent${application_theme}.html?id=${article.id}
				</authz:authorize>
			</c:set>
			<li><a href="${articleContent}" title="${article.overview}">${article.title} <span>discussed ${article.commentsNumber} times</span></a></li>		
		</c:forEach>	
	</ul>
	
	
	<script type="text/javascript">
	var tabs=new ddtabcontent("tabs")
	tabs.setpersist(false)
	tabs.setselectedClassTarget("link")
	tabs.init()
	</script>
	
	</div>

<span class="foot"></span>
</div>


<div class="box_a" id="widget_V">

		<h2>Talking Cat Turf War<a href="#minimize" class="Sminimize"></a><a href="#close" class="Sclose"></a></h2>
	<div>
	<p><object width="304" height="204"><param name="movie" value="http://www.youtube.com/v/P3GT4-m_6RQ&amp;hl=en_US&amp;fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/P3GT4-m_6RQ&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="304" height="204"></object></p>
	<p><a href="http://deluxethemes.com/comfy/category/videos/"><strong>See all videos</strong></a></p>
	</div>
	
<span class="foot"></span>
</div>


<ul class="widgets">

	<li>
		<h2>Recent Comments<a href="#minimize" class="Wminimize"></a><a href="#close" class="Wclose"></a></h2>
		<ul>
			<c:forEach var="comment" items="${lastComments}" varStatus="rowCounter">
				<li><a title="${comment.nickname} : ${comment.date}" href="getArticleContent.html?id=${comment.article.id}#comments">${comment.nickname} : ${comment.title}</a></li>
			</c:forEach>
		</ul>
		<span class="foot"></span>
	</li>

</ul>

<div class="clear"></div>

<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ANONYMOUS">
	<ul class="widgetsl">
		<li><h2>Popular Tags</h2>
		<ul>
			<li>
				<c:forEach var="tag" items="${allTags}" varStatus="rowCounter">
					<c:if test="${tag[1]>1}">
						<a href="getArticlesByTag.html?tagName=${tag[0]}" class="tag-link-${2*tag[1]}" style="font-size: ${2.6*tag[1]}pt;">${tag[0]}</a>
					</c:if>
				</c:forEach>
			</li>
		</ul>
		<span class="foot_s">
		</span>
		</li>	
	</ul>
	
	<ul class="widgetsr">	
		<li><h2>Archives</h2>
		<ul>	
			<c:forEach var="archives" items="${archives}" varStatus="rowCounter">
				<li><a href="getArticlesByDate.html?${archives.key}">${archives.value}</a></li>
			</c:forEach>
		</ul>
		<span class="foot_s"></span></li>	
	</ul>
	
	<div class="clear"></div>
</authz:authorize>

